﻿using Youz.Common.BLL;
using Youz.Common.Entity;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Youz.CreditRepay.Manage.CMS
{
    public partial class CMS_LeaveWordsDetails : System.Web.UI.Page
    {
        CMS_LeaveWordsBLL bll = new CMS_LeaveWordsBLL();
        CMS_LeaveWordsDetailsBLL detailsBll = new CMS_LeaveWordsDetailsBLL();

        protected CMS_LeaveWords model;
        protected DataTable dtDetails;
        protected bool iserror;
        protected void Page_Load(object sender, EventArgs e)
        {
            string leaveWordsID = Request.QueryString["leaveWordsID"];
            Guid guidId;
            if (string.IsNullOrWhiteSpace(leaveWordsID))
            {
                iserror = true;
                return;
            }
            if (!Guid.TryParse(leaveWordsID, out guidId))
            {
                iserror = true;
                return;
            }
            model = bll.Get(guidId);
            if (model == null)
            {
                iserror = true;
                return;
            }
            detailsBll.UpdateIsRead(leaveWordsID, false);
            dtDetails = detailsBll.Gets(string.Format("leaveWordsID='{0}' order by createtime asc", leaveWordsID)).Tables[0];
        }
    }
}